package com.qinggeng.project.system.mapper;

import java.util.List;
import com.qinggeng.project.system.domain.GoodsKeep;
import org.apache.ibatis.annotations.Param;

/**
 * 商品库存信息Mapper接口
 * 
 * @author qinggeng
 * @date 2020-06-15
 */
public interface GoodsKeepMapper 
{
    /**
     * 查询商品库存信息
     * 
     * @param keepId 商品库存信息ID
     * @return 商品库存信息
     */
    public GoodsKeep selectGoodsKeepById(Long keepId);

    /**
     * 查询商品库存信息列表
     * 
     * @param goodsKeep 商品库存信息
     * @return 商品库存信息集合
     */
    public List<GoodsKeep> selectGoodsKeepList(GoodsKeep goodsKeep);

    /**
     * 新增商品库存信息
     * 
     * @param goodsKeep 商品库存信息
     * @return 结果
     */
    public int insertGoodsKeep(GoodsKeep goodsKeep);

    /**
     * 修改商品库存信息
     * 
     * @param goodsKeep 商品库存信息
     * @return 结果
     */
    public int updateGoodsKeep(GoodsKeep goodsKeep);

    /**
     * 删除商品库存信息
     * 
     * @param keepId 商品库存信息ID
     * @return 结果
     */
    public int deleteGoodsKeepById(Long keepId);

    /**
     * 批量删除商品库存信息
     * 
     * @param keepIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteGoodsKeepByIds(Long[] keepIds);


    /**
     * 查询商品库存
     * @param goodsId 商品
     * @param shopId 商户
     * @return
     */
    GoodsKeep selectGoodsKeepByGoodsId(@Param("goodsId") Long goodsId,@Param("shopId") Long shopId);



    int subKeepNum(@Param("goodsId") Long goodsId,@Param("shopId") Long shopId,@Param("goodsNum") Integer goodsNum);

    int subKeepNum1(@Param("goodsId") Long goodsId,@Param("shopId") Long shopId,@Param("keepNum")Integer keepNum,@Param("goodsNum") Integer goodsNum);


    int addKeepNum(@Param("goodsId") Long goodsId,@Param("shopId") Long shopId,@Param("goodsNum") Integer goodsNum);

    void updateGoodsKeepAutoAddSale(Integer number);
}
